﻿using RuoVea.Service;
using Microsoft.AspNetCore.Mvc;

namespace RuoVea.Api.Controllers
{
    /// <summary>
    /// 操作日志服务
    /// </summary>
    public class SysOpLogController :    ApiBaseController 
    {
        private readonly ISysOpLogService _sysOpLogService;
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sysOpLogService"></param>
        public SysOpLogController(ISysOpLogService sysOpLogService)
        {
            _sysOpLogService = sysOpLogService;
        }

        /// <summary>
        /// 分页查询操作日志
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpGet("/sysOpLog/page")]
        public async Task<dynamic> QueryOpLogPageList([FromQuery] OpLogInput input)
        {
            return await _sysOpLogService.QueryOpLogPageList(input);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpGet("/sysOpLog/userpage")]
        public async Task<dynamic> QueryUserOpLogPageList([FromQuery] OpLogInput input)
        {
            return await _sysOpLogService.QueryUserOpLogPageList(input);
        }
        
        /// <summary>
        /// 清空操作日志
        /// </summary>
        /// <returns></returns>
        [HttpPost("/sysOpLog/delete")]
        public async Task ClearOpLog()
        {
              await _sysOpLogService.ClearOpLog( );
        }
    }
}